<?php
$selected_pro = isset($selected_pro) ? $selected_pro : 0;
$selected_pro_setting = array(
    'table_name' => 'pro',
    'key_field' => 'id',
    'value_field' => 'nom',
    'init_data' => array('key' => 0, 'name' => 'Public pour tous')
);
$selected_plv_cat = isset($selected_plv_cat) ? $selected_plv_cat : 1;
$selected_plv_setting = array(
    'table_name' => 'plv_pro_cat',
    'key_field' => 'id',
    'value_field' => 'nom'
);
?>
<div id="wrapper-content">
    <table class="titrepage" width="100%">
        <tr>
            <td >Ajouter P.L.V</td>
            <td align="right"> </td>
        </tr>
    </table>
    <?php echo form_open_multipart('fichiers/add_pro_plv') ?>
    <table width="100%" class="list">
        <tr>
            <td width="30%" >Fichier</td>
            <td><input type="file" name="userfile" size="20"></td>
            <td><?php if (isset($error))
        echo $error; ?></td>
        </tr>
        <tr>
            <td width="30%" >Nom</td>
            <td><input type="text" name="txtName" size="30" value="<?php echo set_value('txtName') ?>"/></td>
            <td><?php echo form_error("txtName") ?></td>
        </tr>
        <tr>
            <td><label for="pro">Plv categorie</label></td>
            <td><?php echo form_dropdown('plv_cat', dropdown_data($selected_plv_setting), $selected_plv_cat) ?></td>
            <td></td>
        </tr>
        <tr>
            <td><label for="pro">Proffesionel</label></td>
            <td><?php echo form_dropdown('pro', dropdown_data($selected_pro_setting), $selected_pro) ?></td>
           <td></td>
        </tr>
        <tr>
            <td></td> <td><input type="submit" value="Add" name ="submit"/> </td> <td></td>
        </tr>
    </table>

</div>
